
local mt = ac.skill['拍击']
mt.model1 = [[Abilities\Spells\Human\Thunderclap\ThunderClapCaster.mdl]]

function mt:on_add()
    local hero = self.owner
    hero:add_restriction '定身'
    self:gc(hero:add('攻击距离',800))
    self:gc(hero:event '单位-拦截造成伤害'(function(_,data)
        if data:is_attack() then
            local point1 = hero:get_point()
            local point2 = data.target:get_point()
            local angle = point1 / point2
            for a=1,9 do
                local point = point1 - {angle,150*a}
                --ac.hint_red(point,150,0.5)
                ac.wait(500,function()
                    point:add_effect(self.model1):remove()
                end)
            end
            point1:effect{
                model = [[fdcd174428a0c65293cd271ce959629e.mdx]],
                height = 90,
                angle = angle,
                time = 1.5,
            }
            hero:add_restriction '硬直'
            ac.wait(0,function()
                hero:play_animation(4)
            end)
            ac.wait(500,function()
                hero:remove_restriction '硬直'
                local damage = hero:get('攻击') * self.data1/100
                hero:line_damage(point1,angle,1200,150,damage,self)
            end)
            return true
        end
    end))
end
